<?php
namespace Modules\AuthAdmin\Http\Controllers\v1;
use Illuminate\Http\Request;
use Modules\AuthAdmin\Http\Requests\LoginRequest;
use Modules\AuthAdmin\Models\AuthAdmin as AuthAdminModel;
use Illuminate\Support\Facades\DB;
class LoginController extends CommonController
{		
	/**	 
	 * @name  用户登录	
	 * @method  POST	
	 * @param username 账号	
	 * @param password 密码	
	 */
    public function login(LoginRequest $request)
    {
		return (new AuthAdminModel())->login($request->all());
    }
	/*$users = DB::table('user_infos')->paginate(100);
		
		$arr = [];
		foreach($users as $v){
			$user = [];
			$user['xcx_open_id'] = $v->openid;	
			$user['admin_id'] = $v->community_id;
			$user['nick_name'] = $v->nickname;
			$user['avatar_url'] = $v->img;
			$user['name'] = $v->name;
			$user['phone'] = $v->mobile;
			$user['area_str'] = $v->address;
			$user['created_at'] = date("Y-m-d H:i:s",$v->createTime);
			$user['updated_at'] = date("Y-m-d H:i:s",$v->updateTime);
			if($user['phone']){
				$user['plot_status'] = 1;
			}
			$user['password'] = bcrypt('123456');
			if(!DB::table('users')->insert($user)){
				if(!DB::table('users')->insert($user)){
					DB::table('users')->insert($user);
				};
			};
		}
		return 333;*/
}
